/**
 * Copyright &copy; 2012-2014 <a href="https://github.com/thinkgem/jeesite">JeeSite</a> All rights reserved.
 */
package com.thinkgem.jeesite.modules.jxc.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.service.TreeService;
import com.thinkgem.jeesite.common.utils.StringUtils;
import com.thinkgem.jeesite.modules.jxc.entity.JxcProductkind;
import com.thinkgem.jeesite.modules.jxc.dao.JxcProductkindDao;

/**
 * 商品类别Service
 * @author 马万进
 * @version 2016-07-23
 */
@Service
@Transactional(readOnly = true)
public class JxcProductkindService extends TreeService<JxcProductkindDao, JxcProductkind> {

	public JxcProductkind get(String id) {
		return super.get(id);
	}
	
	public List<JxcProductkind> findList(JxcProductkind jxcProductkind) {
		if (StringUtils.isNotBlank(jxcProductkind.getParentIds())){
			jxcProductkind.setParentIds(","+jxcProductkind.getParentIds()+",");
		}
		return super.findList(jxcProductkind);
	}
	
	@Transactional(readOnly = false)
	public void save(JxcProductkind jxcProductkind) {
		super.save(jxcProductkind);
	}
	
	@Transactional(readOnly = false)
	public void delete(JxcProductkind jxcProductkind) {
		super.delete(jxcProductkind);
	}
	
}